cc.Class({
    extends: cc.Component,

    properties: {
        content: cc.Sprite,
        speed: 0.1,
        _effectIndex: 0,
    },
    
    // LIFE-CYCLE CALLBACKS:

    onLoad () {
    },

    onEnable () {
        this.originState = cc.dynamicAtlasManager.enabled;
        cc.dynamicAtlasManager.enabled = false;
    },

    onDisable () {
        cc.dynamicAtlasManager.enabled = this.originState;
    },

    start () {
        this.time = 0;
        this.contentSpriteMaterial = this.content.getMaterial(0);
    },

    update (dt) {
        if ( !this.contentSpriteMaterial) return;

        this.time += dt;
        this.sin = Math.sin(this.time)*20;
        if(this.time >= 3){
            this.sin = 0;
            this.time = 0;
        }

        this.contentSpriteMaterial.setProperty('time', this.time);
    },
});